const list = document.querySelector('.tab-list')
const content = document.querySelectorAll('.screen-content .content')
    list.addEventListener('click',function(e){
            if(e.target.tagName === 'A') {
                const aAct = document.querySelector('.tab-list .actively')
                if(aAct){
                    aAct.classList.remove('actively')
                }
                e.target.classList.add('actively')
                const index = e.target.dataset.index
                console.log(index)
                for(let i = 0; i < content.length; i++) {
                    content[i].style.display = 'none'
                }
                content[index].style.display = 'block'
            }
        })
//侧边栏
(function(){
    //二维码显示
    const scan = document.querySelector(`.scan`)
    const qrcode = document.querySelector(`.qrcode`)
    scan.addEventListener(`mouseenter`,function(){
        qrcode.style.display = `block`
    })
    scan.addEventListener(`mouseleave`,function(){
        qrcode.style.display = `none`
    })
    //返回顶部显示
    const ico_top = document.querySelector(`.ico_top`)
    const main_picture = document.querySelector(`.main_picture`)
    window.addEventListener(`scroll`, function(){
        const n = this.document.documentElement.scrollTop
        if (n >= main_picture.offsetTop) {
            ico_top.style.display = `block`
          } else {
            ico_top.style.display = `none`
          }
    })
})();